package independentes;

public class BubbleSort implements Runnable {
	
	private int[] v;
	
	public BubbleSort(int[] v) {
		this.v = v;
	}
	
	public void change(int[] v, int i, int j) {
		if (v[i] > v[j]) {
			int aux = v[i];
			v[i] = v[j];
			v[j] = aux;
		}
	}

	@Override
	public void run() {
		for (int i = 0; i < v.length; i++) {
			for (int j = i + 1; j < v.length; j++) {
				change(v, i, j);
			}
		}
	}
}